package com.text.mqtt_text.pojo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Result {

    //传送信息

    private int body;//坐姿01表示
    private double head;//额头温度
    private double humidity;//湿度
    private double temperature;//温度
    private String data;//信息

    //成功
    public static Result success(int body,double head,double humidity, double temperature) {
        return new Result(body, head, humidity, temperature, "success");
    }


    //失败
    public static Result failure() {
        return new Result(1,0,0,0,"没有获取到信息");
    }

    public static Result success() {
        return new Result();
    }


//    //响应失败
//    public static Result error(String msg){
//        return new Result(0, msg, null);
//    }
//    //toString方法
}